package com.hnevc.androiduiclassone3;

import android.nfc.Tag;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.RadioGroup;

public class MainActivity extends AppCompatActivity{


    private static final String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.control_layout);

        RadioGroup radioGroup = findViewById(R.id.rg_sex);
        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                Log.e(TAG, "onCheckedChanged: " +checkedId );
                switch (checkedId){
                    case R.id.rb_male:
                        Log.e(TAG, "onCheckedChanged: " +"男" );
                        break;
                    case R.id.rb_female:
                        Log.e(TAG, "onCheckedChanged: " +"女" );
                        break;}
            }
        });


    }
    public void login(View view){
        Log.e(TAG, "login: " +((Button)view).getText() );
    }



}


